//
//  DamInfo.h
//  MapCallouts
//
//  Created by Hideo Tomizu on 10/08/17.
//  Copyright 2010 株式会社ビットウェイ. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <sqlite3.h>

@interface DamInfo : NSObject {
	
	NSInteger dam_cd;//  integer primary key,
	NSDecimalNumber *point_x;//  REAL,
	NSDecimalNumber *point_y;//  REAL,
	NSString *dam_name;//  text,
	NSString *water_name;//  text,
	NSString *river_name;//  text,
	NSInteger *type_cd;//  integer,
	NSInteger *purpose_cd;//  integer,
	NSDecimalNumber *height;//  REAL,
	NSDecimalNumber *width;//  REAL,
	NSInteger *volume;//  integer,
	NSInteger *pondage;//  integer,
	NSInteger *institution_cd;//  integer,
	NSInteger *const_year;//  integer,
	NSInteger *ken_cd;// integer,
	NSString *address;//  text,
	NSInteger *accuracy_cd;//  integer
	
	NSString *ken_name;// text
	
	NSString *type_name;// text
	NSString *purpose_name;// text
	NSString *institution_name;// text
	
	//Intrnal valiable
	BOOL isDirty;
	BOOL isDetailViewHydrated;
}

@property (nonatomic, readonly) NSInteger dam_cd;

/*
@property (nonatomic, copy) NSDecimalNumber *point_x;//  REAL,
@property (nonatomic, copy) NSDecimalNumber *point_y;//  REAL,
@property (nonatomic, copy) NSString *dam_name;//  text,
@property (nonatomic, copy) NSString *water_name;//  text,
@property (nonatomic, copy) NSString *river_name;//  text,
@property (nonatomic, copy) NSInteger *type_cd;//  integer,
@property (nonatomic, copy) NSInteger *purpose_cd;//  integer,
@property (nonatomic, copy) NSDecimalNumber *height;//  REAL,
@property (nonatomic, copy) NSDecimalNumber *width;//  REAL,
@property (nonatomic, copy) NSInteger *volume;//  integer,
@property (nonatomic, copy) NSInteger *pondage;//  integer,
@property (nonatomic, copy) NSInteger *institution_cd;//  integer,
@property (nonatomic, copy) NSInteger *const_year;//  integer,
@property (nonatomic, copy) NSInteger *ken_cd;// integer,
@property (nonatomic, copy) NSString *address;//  text,
@property (nonatomic, copy) NSInteger *accuracy_cd;//  integer
*/

@property (nonatomic, copy) NSDecimalNumber *point_x;//  REAL,
@property (nonatomic, copy) NSDecimalNumber *point_y;//  REAL,
@property (nonatomic, copy) NSString *dam_name;//  text,
@property (nonatomic, copy) NSString *water_name;//  text,
@property (nonatomic, copy) NSString *river_name;//  text,
@property (nonatomic, readonly) NSInteger *type_cd;//  integer,
@property (nonatomic, readonly) NSInteger *purpose_cd;//  integer,
@property (nonatomic, copy) NSDecimalNumber *height;//  REAL,
@property (nonatomic, copy) NSDecimalNumber *width;//  REAL,
@property (nonatomic, readonly) NSInteger *volume;//  integer,
@property (nonatomic, readonly) NSInteger *pondage;//  integer,
@property (nonatomic, readonly) NSInteger *institution_cd;//  integer,
@property (nonatomic, readonly) NSInteger *const_year;//  integer,
@property (nonatomic, readonly) NSInteger *ken_cd;// integer,
@property (nonatomic, copy) NSString *address;//  text,
@property (nonatomic, readonly) NSInteger *accuracy_cd;//  integer

@property (nonatomic, copy) NSString *ken_name; //text 

@property (nonatomic, copy) NSString *type_name;// text
@property (nonatomic, copy) NSString *purpose_name;// text
@property (nonatomic, copy) NSString *institution_name;// text

//Intrnal valiable
@property (nonatomic, readwrite) BOOL isDirty;
@property (nonatomic, readwrite) BOOL isDetailViewHydrated;

//static methods
+ (void) getInitialDataToDisplay:(NSString *)dbPath;
+ (void) finalizeStatements;

//Instance methods.
- (id) initWithPrimaryKey:(NSInteger)pk;
+ (id) getDamInfoDetail:(NSString *)dbPath damCd:(NSInteger) dam_cd;

@end






